import { requestGet ,requestDelete,requestPost} from "../utils/request";

// 获取角色列表
let getRoleList = ()=>requestGet(`roles`);

// 删除指定角色
let removeTagRole = (roleId,rightId)=>requestDelete(`roles/${roleId}/rights/${rightId}`)

// 获取权限列表
let getRightsList = (type)=>requestGet(`rights/${type}`)

// 设置权限
let setRights = (roleId,data)=>requestPost(`roles/${roleId}/rights`,data)

//设置添加角色
let addRoles = (data)=>requestPost(`roles`,data)

//删除角色
let deleteRole = (id)=>requestDelete(`roles/${id}`)
export {
    getRoleList,
    removeTagRole,
    getRightsList,
    setRights,
    addRoles,
    deleteRole
}